Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Do not delete e2e test resources on PR builds #227

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Conversation

vinagesh
Copy link
Contributor

@vinagesh vinagesh commented Aug 20, 2021

This PR mainly moves the configuration of which devices to delete to the pipeline variable rather than a constant value. Once this is checked in, the scheduled run will run as normal, running all tests and cleaning up both e2e and sample created devices.

Apart from that pipeline, I"ll add a new pipeline that will only delete the sample created devices along with running the samples. This pipeline will be enabled on PR builds.

After this is complete, I will make merge these changes to preview branch and create a PR pipeline for the preview branch as well.

@vinagesh vinagesh force-pushed the vinagesh/pipeline branch 3 times, most recently from e3cea50 to dcd3401 Compare August 20, 2021 21:10
@vinagesh vinagesh changed the title cleanupjob Create separate job to delete e2e test resources Aug 20, 2021
@vinagesh vinagesh force-pushed the vinagesh/pipeline branch 13 times, most recently from 6bca383 to 2f862e5 Compare August 21, 2021 00:23
@vinagesh vinagesh changed the title Create separate job to delete e2e test resources Do not delete e2e test resources on PR builds Aug 21, 2021
@@ -29,7 +29,7 @@ internal class Parameters
'd',
"DevicePrefix",
Required = false,
Default = "RegistryManagerSample-",
Copy link
Contributor Author

@vinagesh vinagesh Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing to match prefix style used. This was not in the delete list earlier but the sample deletes the device so this is just to guard against leaked resources. Currently the hub does not have any devices with this prefix so we don't need to worry about deleting the ones with old prefix.

@@ -65,8 +69,29 @@ private async Task CleanupDevices()
excludeKeysInExport: true,
storageAuthenticationType: StorageAuthenticationType.KeyBased);

JobProperties exportAllDevicesJob = await _registryManager.ExportDevicesAsync(exportAllDevicesProperties);
JobProperties exportAllDevicesJob = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding retries on jobs to protect against any currently running job. We could change the total wait time if necessary after observing for a while.

@@ -53,6 +53,10 @@ jobs:
IOTHUB_PFX_X509_THUMBPRINT: $(IOTHUB-PFX-X509-THUMBPRINT)
DPS_IDSCOPE: $(DPS-IDSCOPE)
PROVISIONING_CONNECTION_STRING: $(PROVISIONING-CONNECTION-STRING)
# PATH-TO-DEVICE-PREFIX-FOR-DELETION-FILE is a variable configured on the pipeline. The possible values are: csharp_devices_list.csv, csharp_samples_devices_list.csv.
Copy link
Contributor Author

@vinagesh vinagesh Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is no longer a constant and no longer extracted from keyvault.
https://github.com/Azure/azure-iot-sdk-csharp/pull/2153/files

@vinagesh vinagesh marked this pull request as ready for review August 23, 2021 16:51
@vinagesh vinagesh removed the request for review from barustum August 23, 2021 18:45
@vinagesh vinagesh merged commit 70144eb into master Aug 24, 2021
@vinagesh vinagesh deleted the vinagesh/pipeline branch August 24, 2021 17:33
vinagesh added a commit that referenced this pull request Aug 24, 2021
* Do not delete e2e test resources on PR builds (#227)

* Remove barustum from CODEOWNERS (#224)

Co-authored-by: Basel Rustum <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants